package quadrato;

public class Square {

    private double lato;

    public boolean setLato(double pLato) {
        if (pLato > 0) {
            this.lato = pLato;
            return true;
        }
        return false;
    }

    public double getLato() {
        return this.lato;
    }

    public double perimetro() {
        double perimetro = this.lato * 4;
        return perimetro;
    }

    public double area(){
        double area= this.lato*this.lato;
        return area;
    }
    @Override
    public String toString(){
        String ritorna= this.lato+" x "+this.lato;
        return ritorna;
    }
    @Override
    public boolean equals(Object t){
        if(t instanceof Square){
        Square tt= (Square) t;
        return this.lato == tt.lato;
        }
        return false;
    }
}
